﻿@using SCMS.Resource
@model SCMS.UI.Models.AdvanceRequestBLModel
@{AjaxOptions ajaxOpts = new AjaxOptions
      {
          UpdateTargetId = "R4ADiv",
          LoadingElementId = "loading",
          HttpMethod = "Post",
          Url = Url.Action("SaveRFADetail"),
          OnBegin = "checkBalance",
          OnSuccess = "ClearForm"
      };}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    <table>
        <tr>
            <td align="right" valign="top"  class="editor-label">
                @Resources.Request4Advance_CreateRFADetail_RequestFor:
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.AdvanceOptionId, Model.AdvanceOptions, Resources.Global_String_PleaseSelect)
                @Html.HiddenFor(model => model.Id)
                @Html.HiddenFor(model => model.AdvanceRequestId)
                @Html.ValidationMessageFor(model => model.AdvanceOptionId, Resources.Global_String_Required)
            </td>
        </tr>
        <tr>
            <td align="right" valign="top"  class="editor-label">
                @Resources.Global_String_Description:
            </td>
            <td align="left" class="editor-field">
                @Html.TextAreaFor(model => model.Description, new { @rows = "3"})
            </td>
        </tr>
        <tr>
            <td align="right" valign="top"  class="editor-label">
                @Resources.Budget_CategoryList_ProjectNo:
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.ProjectId, Model.ProjectNos, Resources.Global_String_PleaseSelect, new { @id = "dplProjectNo", onchange = "javascript:selectedIndexChange(this)" })
            </td>
        </tr>
        <tr>
            <td align="right" valign="top"  class="editor-label">
                @Resources.Budget_CreateSubLine_LineNumber:
            </td>
            <td align="left" class="editor-field">
                <div id="PBlines">
                    @Html.DropDownListFor(model => model.BudgetLineID, Model.BudgetLines, Resources.Global_String_PleaseSelect, new { @class = "dpl", @id = "BudgetLineID", onchange = "javascript:checkBalance()" })
                    @Html.ValidationMessageFor(model => model.BudgetLineID, Resources.Global_String_Required)
                </div>
            </td>
        </tr>
        <tr>
            <td align="right" valign="top"  class="editor-label">
                @Resources.Global_String_Amount:
            </td>
            <td align="left" class="editor-field">
                @Html.TextBoxFor(model => model.Amount, new { id = "TotalPrice", @class="numericTb", @autocomplete="off" })
                @Html.ValidationMessageFor(model => model.Amount, Resources.Global_String_Required)
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <div id="fundsCheck"></div>
            </td>
        </tr>
        <tr>
            <td align="right" class="editor-label">
                &nbsp;
            </td>
            <td align="left" class="editor-field">
                &nbsp;<input type="submit" class="btn green"  value=" @Resources.Global_String_Save " />
            </td>
        </tr>
    </table>
}